<?
include("./_common.php");
include("$g4[path]/_head.php");

$shop = get_shop();

if(trim($_SESSION["g4_oid"])!="")
{
	$order_row = mysql_fetch_array(mysql_query("select * from g4_order where oid = '".$_SESSION["g4_oid"]."' limit 1"));
	$tmp_status_history = explode("/",$order_row[status_history]);
	$tmp_status_history[] = "1|".date("Y-m-d H:i:s");
	$status_history = implode("/",$tmp_status_history);

	$order_update_sql = "update g4_order set status = '1', status_history = '".$status_history."' where oid = '".$_SESSION["g4_oid"]."' limit 1";

	$order_update_rst = mysql_query($order_update_sql);
	
	if($order_update_sql)
	{
		$_SESSION["tmp_oid"] = $_SESSION["g4_oid"];
		$_SESSION["g4_oid"] = "";
	}
}

$order_row = mysql_fetch_array(mysql_query("select * from g4_order where oid = '".$_SESSION["tmp_oid"]."' limit 1"));
$bank_info = explode("|",$order_row[pay_info]);
?>
<link rel="stylesheet" href="<?=$g4['path']?>/shop/style.css" type="text/css">
<script language="javascript" src="<?=$g4['path']?>/shop/shop.js"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td align="center">
			<table cellpadding="5" cellspacing="0" border="0" width="500" style="border:solid 1px #D7D7D7">
				<colgroup>
					<col width="120">
					<col width="">
				</colgroup>
				<tr>
					<td class="orderIndex">입금하실 은행</td>
					<td><?=$bank_info[0]?></td>
				</tr>
				<tr><td colspan="2" height="1" bgcolor="#D7D7D7"></td></tr>
				<tr>
					<td class="orderIndex">입금하실 계좌</td>
					<td><span style="font-weight:bold;color:#000099"><?=$bank_info[1]?></span></td>
				</tr>
				<tr><td colspan="2" height="1" bgcolor="#D7D7D7"></td></tr>
				<tr>
					<td class="orderIndex">예금주명</td>
					<td><?=$bank_info[2]?></td>
				</tr>
				<tr><td colspan="2" height="1" bgcolor="#D7D7D7"></td></tr>
				<tr>
					<td class="orderIndex">입금자명</td>
					<td><?=$order_row[pay_user]?></td>
				</tr>
				<tr><td colspan="2" height="1" bgcolor="#D7D7D7"></td></tr>
				<tr>
					<td class="orderIndex">입금하실 금액</td>
					<td><span style="font-weight:bold;color:#990000"><?=number_format($order_row[pay_amount])?>원</span></td>
				</td>
				<tr><td colspan="2" height="1" bgcolor="#D7D7D7"></td></tr>
				<tr>
					<td colspan="2" style="padding:10px">
					주문후 7일 이내에 입금해 주시기 바랍니다.<br>
					실제 입금하신분과 작성하신 입금자명이 다를경우 연락주시기 바랍니다.<br>
					감사합니다.
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td align="center" height="50">
		<button class="cart_btn1" onclick="location.href='order_step4.php?method=bank&oid=<?=$_SESSION["tmp_oid"]?>'">완료</button>
		</td>
	</tr>
</table>
<?
include("$g4[path]/_tail.php");
?>